{% import 'macros/footer.html' as macros_footer -%}
{% import 'macros/header.html' as macros_header -%}
{% import 'macros/javascript.html' as macros_js -%}
{% import 'macros/docs-sidebar.html' as macros_sidebar -%}
{% import 'macros/docs-edit-page.html' as macros_edit_page -%}
{% import 'macros/docs-navigation.html' as macros_navigation -%}
{% import 'macros/docs-toc.html' as macros_toc -%}
{% import 'macros/page-publish-metadata.html' as macros_publish -%}
{% import 'macros/youtube.html' as youtube -%}


<!DOCTYPE html>
<html lang="{{ config.extra.language_code | default(value=" en-US") }}" >
<head>
     {% if page.extra.meta %}
         <!-- the meta data config goes here  -->
         {% for data in page.extra.meta %}
             <meta
                 {% for key, value in data%}
                     {% if key == "property" and value == "og:title"%}
                         {% set_global page_has_og_title = true -%}
                     {% endif %}
                     {% if key == "property" and value == "og:description"%}
                         {% set_global page_has_og_description = true -%}
                     {% endif %}
                     {% if key == "name" and value == "description"%}
                         {% set_global page_has_description = true -%}
                     {% endif %}
                     {{ key }}="{{ value }}"
                {% endfor %}
            />
        {% endfor %}
    {% endif %}

    {# Site title #}
    {% set current_path = current_path | default(value="/") %}
    {% if current_path == "/" %}
      <title>
          {{ config.title | default(value="Home") }}
      </title>

    {% else %}
      <title>
          {% if page.title %} {{ page.title ~ " - Loco.rs" }}
          {% elif section.title %} {{ section.title ~ " - Loco.rs" }}
          {% elif config.title %} {{ config.title }}
          {% else %} Post  ~ " - Loco.rs" {% endif %}
      </title>

      {% if not page_has_og_title %}
          <meta property="og:title" content="{% if page.title -%}{{ page.title }}{% elif config.title -%}{{ config.title }}{% else -%}Post{% endif %} - Loco.rs" />
          <meta property="og:title" content="{% if page.title -%}{{ page.title }}{% elif config.title -%}{{ config.title }}{% else -%}Post{% endif %} - Loco.rs">  
          <meta name="twitter:title" content="{% if page.title -%}{{ page.title }}{% elif config.title -%}{{ config.title }}{% else -%}Post{% endif %} - Loco.rs"> 
      {% endif %}
    {% endif %}


     {% if not page_has_og_description %}
         {% if page.description %}
             <meta property="og:description" content="{{ page.description }}" />
         {% elif config.description %}
             <meta property="og:description" content="{{ config.description }}" />
         {% endif %}
     {% endif %}

     {% if not page_has_description %}
         {% if page.description %}
             <meta name="description" content="{{ page.description }}" />
         {% elif config.description %}
             <meta name="description" content="{{ config.description }}" />
         {% endif %}
    {% endif %}


  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />


  <meta property="og:image" content="https://loco.rs/apple-touch-icon@x4.png">

  <meta name="twitter:card" content="summary_large_image"> 
  <meta name="twitter:description" content="Loco.rs is like Ruby on Rails for Rust. Use it to quickly build and deploy Rust based apps from zero to production.">
  <meta name="twitter:image" content="https://loco.rs/apple-touch-icon@x4.png">
  
  

  <link rel="stylesheet" type="text/css" href={{ get_url(path="styles/styles.css" ) }} />
  <link rel="stylesheet" type="text/css" href={{ get_url(path="syntax-theme-light.css" ) }} />
  <link rel="stylesheet" type="text/css" href={{ get_url(path="syntax-theme-dark.css" ) }} />

  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800" rel="stylesheet">

  <link rel="apple-touch-icon" sizes="180x180" href={{ get_url(path="apple-touch-icon.png" ) }}>
  <link rel="icon" type="image/png" href={{ get_url(path="favicon-32x32.png" ) }}>

</head>

<body class="bg-background">
  <div class="dark"></div>
  <div class="relative flex min-h-screen flex-col ">
    {% block header %}
    {{ macros_header::header(current_section="/") }}
    {% endblock header %}

    {% block content %}{% endblock content %}
  </div>

  {{macros_footer::footer()}}
  {{ macros_js::javascript() }}

</body>

</html>
